package icu.zqyhdm.blog.openFeign;

import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description
 * @Author lifu
 * @Date 2021/7/7 20:36
 */
@FeignClient(value = "common-service")
@Component
public interface CommonServiceFeignClient {

    /**
     * 发送手机验证码
     */
    @GetMapping(value = "/api/common-service/message/sendCode/{phone}")
    String sendCode(@PathVariable("phone") String phone);

    /**
     * 上传文件到阿里云oss
     */
    @PostMapping(value = "/api/common-service/oss/fileUpload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String fileUpload(@RequestPart(value = "file") MultipartFile multipartFile, @RequestParam("fileUrl") String fileUrl);

}
